/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.games.epkb.entityClasses;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author plebani
 */
@Entity
@Table(name = "update_kb")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "UpdateKb.findAll", query = "SELECT u FROM UpdateKb u"),
    @NamedQuery(name = "UpdateKb.findById", query = "SELECT u FROM UpdateKb u WHERE u.id = :id"),
    @NamedQuery(name = "UpdateKb.findByUpdatedTable", query = "SELECT u FROM UpdateKb u WHERE u.updatedTable = :updatedTable")})
public class UpdateKb implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private String id;
    @Column(name = "UpdatedTable")
    private String updatedTable;
    @JoinColumn(name = "ID", referencedColumnName = "ID", insertable = false, updatable = false)
    @OneToOne(optional = false)
    private Actions actions;

    public UpdateKb() {
    }

    public UpdateKb(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getUpdatedTable() {
        return updatedTable;
    }

    public void setUpdatedTable(String updatedTable) {
        this.updatedTable = updatedTable;
    }

    public Actions getActions() {
        return actions;
    }

    public void setActions(Actions actions) {
        this.actions = actions;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UpdateKb)) {
            return false;
        }
        UpdateKb other = (UpdateKb) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "it.polimi.games.epkb.entityClasses.UpdateKb[ id=" + id + " ]";
    }
    
}
